import { http } from "@/utils/http";
import type { No, Request, Response } from "@/api";
import type { CaptchaData } from "@/api/security";

const service = "security";

/** 获取验证码 此接口在白名单中，不需要验证 token POST /api/captcha-code */
export async function captchaCode(
  request: Request<No>
): Promise<Response<CaptchaData>> {
  return http.post<Request<No>, Response<CaptchaData>>(
    `${service}/api/captcha-code`,
    { data: request }
  );
}
